import config from "@/config"
import http from "@/utils/request"
export default {
    save: {
        url: `${config.API_URL}/core/meta/pageTemplate/savePageTemplateFile`,
        name: "保存",
        post: async function (data, config = {}) {
            return await http.post(this.url, data, config);
        }
    },
    load: {
        url: `${config.API_URL}/core/meta/pageTemplate/loadPageTemplateFile`,
        name: "初始化",
        post: async function (data, config = {}) {
            return await http.post(this.url, data, config);
        }
    },
    export: {
        url: `${config.API_URL}/core/meta/pageTemplate/savePageTemplateToExcelFile`,
        name: "导出",
        post: async function (data, config = {}) {
            return await http.post(this.url, data, config);
        }
    },
    uploadfile: {
		url: `${config.API_URL}/core/system/file/downloadFile`,
		name: "上传文件",
		post: async function (data, config = {}) {
			return await http.post(this.url, data, { responseType: 'blob'});
		}
	},
    saveUploadxcelFile: {
        url: `${config.API_URL}/core/meta/pageTemplate/saveUploadxcelFile`,
        name: "导出",
        post: async function (data) {
            return await http.post(this.url, data, { headers: { 'Content-Type': 'multipart/form-data' } });
        }
    },
    excelConfig:{
        init: {
            url: `${config.API_URL}/core/report/importExcel/config/initConfigRule`,
            name: "初始化",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        uploadfile: {
            url: `${config.API_URL}/core/system/file/downloadFile`,
            name: "上传文件",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, { responseType: 'blob'});
            }
        },
        saveConfigRuleToExcelFile: {
            url: `${config.API_URL}/core/report/importExcel/config/saveConfigRuleToExcelFile`,
            name: "上传文件",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
        saveConfigRule: {
            url: `${config.API_URL}/core/report/importExcel/config/saveConfigRule`,
            name: "上传文件",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
        loadImportRuleFile: {
            url: `${config.API_URL}/core/report/importExcel/config/loadImportRuleFile`,
            name: "加载sheet",
            post: async function (data, config = {}) {
                return await http.post(this.url, data,config);
            }
        },
    },
    reportConfig:{
        initReportDesigner: {
            url: `${config.API_URL}/core/report/reportDesigner/initReportDesigner`,
            name: "初始化报表设计",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        saveReportTemplateToFile: {
            url: `${config.API_URL}/core/report/reportDesigner/saveReportTemplateToFile`,
            name: "保存报表设计",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
    },
    
    
    
}